package com.wxn.learncompose.pagers

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Scaffold
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier

@Composable fun ScaffoldCardPager2() {
    var selectedIndex = remember{ mutableStateOf(0) }

    Scaffold(
        modifier = Modifier.fillMaxSize(),
        topBar = { MyTopBar()} ,
        bottomBar = { MyBottomNavigateBar(selectedIndex)}
    ) {paddings ->
        Column(modifier = Modifier.padding(paddings)) {}
        when(selectedIndex.value) {
            0 -> { Home() }
            1 -> { Favorite() }
            2 -> { Setting() }
        }
    }
}

@Composable
fun MyTopBar() {
    TitleBar()
}
